/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.gas.barapraja.admin.db.entity;

import java.io.Serializable;

/**
 *
 * @author SWG
 */

public class Chanel implements Serializable {
    private static final long serialVersionUID = 1L;
    
    private Long id;
    
    private String chanelId;
    
    private String chanelName;
    
    private int creditAllocated;
    
    private int creditUsed;
    
    private int creditBalance;
    
    private long smsSent;
    
    private Token token; 

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getChanelId() {
        return chanelId;
    }

    public void setChanelId(String chanelId) {
        this.chanelId = chanelId;
    }

    public String getChanelName() {
        return chanelName;
    }

    public void setChanelName(String chanelName) {
        this.chanelName = chanelName;
    }

    public int getCreditAllocated() {
        return creditAllocated;
    }

    public void setCreditAllocated(int creditAllocated) {
        this.creditAllocated = creditAllocated;
    }

    public int getCreditBalance() {
        return creditBalance;
    }

    public void setCreditBalance(int creditBalance) {
        creditBalance = creditAllocated - creditUsed;
        this.creditBalance = creditBalance;
    }

    public int getCreditUsed() {
        return creditUsed;
    }

    public void setCreditUsed(int creditUsed) {
        this.creditUsed = creditUsed;
    }

    public Long getSmsSent() {
        return smsSent;
    }

    public void setSmsSent(long smsSent) {
        this.smsSent = smsSent;
    }

    public Token getToken() {
        return token;
    }

    public void setToken(Token token) {
        this.token = token;
    }

    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Chanel)) {
            return false;
        }
        Chanel other = (Chanel) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.gas.barapraja.admin.db.entity.Chanel[ id=" + id + " ]";
    }
    
}
